package com.zlzxm.sorting.ui.adapter

import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.CenterCrop
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.zlzxm.sorting.R
import com.zlzxm.sorting.globe.dp2px
import com.zlzxm.sorting.ui.adapter.entity.EntityMerchant

class AdapterSortingMerchant : BaseQuickAdapter<EntityMerchant,BaseViewHolder> (
    R.layout.item_merchant
        ){

    override fun convert(holder: BaseViewHolder, item: EntityMerchant) {

        Glide.with(context)
            .load(item.face)
            .transform(CenterCrop(),RoundedCorners(dp2px(30f)))
            .into(holder.getView(R.id.ivFace))

        holder.setText(R.id.tvTitle,item.title)

        holder.setText(R.id.tvProcess,"分拣进度 ${item.process} / ${item.total}")

    }


}